package com.example;

/**
 * @desc:
 * @author: Shoko
 * @date: 2025/6/1
 */
// 故障状态
class FaultState implements ElevatorState {
    private Elevator elevator;

    public FaultState(Elevator elevator) {
        this.elevator = elevator;
    }

    @Override
    public void moveToFloor(int floor) {
        System.out.println("电梯故障，无法移动");
    }

    @Override
    public void openDoor() {
        System.out.println("电梯故障，无法开门");
    }

    @Override
    public void closeDoor() {
        System.out.println("电梯故障，无法关门");
    }

    @Override
    public void markFault() {
        System.out.println("电梯已经处于故障状态");
    }

    @Override
    public void fixFault() {
        System.out.println("电梯故障已修复，准备就绪");
        elevator.changeState(new IdleState(elevator));
    }
}
